<template>
  <a-select
    v-model="formModel"
    allow-clear
    multiple
    placeholder="请选择"
  >
    <a-option
      v-for="item of postList"
      :key="item.postId"
      :value="item.postId"
      :tag-props="{color: 'blue'}"
    >
      {{ item.postName }}
    </a-option>
  </a-select>
</template>

<script lang="ts" setup>
import { ref, defineModel, onMounted } from 'vue';
import { postSelect } from '@/api/system/post';

const formModel = defineModel({ type: Array });

const postList = ref();

onMounted(() => {
  postSelect().then(res => {
    postList.value = res.data;
  });
});
</script>

<script lang="ts">
export default {
  name: 'BusinessPostSelect'
};
</script>

<style scoped lang="less">

</style>